import common.comvariable
from common.basedriver import BaseDriver
from selenium.webdriver.support.wait import WebDriverWait


def decorator(driver=BaseDriver.driver):
    def realDecorator(func):
        def waitFun(*args):
            print("test2")
            WebDriverWait(driver,10,0.5).until(func).click()
        return waitFun
    return realDecorator

class Demo(BaseDriver):

    @decorator()
    def findFlight():
        return BaseDriver.driver.find_element_by_css_selector("#searchBoxUl>li:nth-child(2)")

demo=Demo()
Demo.findFlight()
